package org.example.service.impl;

import org.example.pojo.Product;
import org.example.service.ProductService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getById(Integer id) {
        return new Product(id,"产品"+id, BigDecimal.valueOf(id+100));
    }

    @Override
    public List<Product> getList() {
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Integer id=102;
        return Arrays.asList(new Product(id,"产品"+id, BigDecimal.valueOf(id+100))
                ,new Product(id,"产品"+id, BigDecimal.valueOf(id+100))
        ,new Product(id,"产品"+id, BigDecimal.valueOf(id+100)));
    }
}
